macromedia Your Account International Help
Products Support & Training DevNet Solutions Partners Downloads Store
Products Support & Training DevNet Solutions Partners Downloads Store
Home > Products > Director > Support > TechNote Index
Macromedia Director Support Center - TechNote

netDone() function returns 0 (FALSE)

Issue
netDone() Function returns 0 (FALSE), when used in a Shockwave movie (DCR). This is not an issue when used in authoring or projectors.

Reason
The netDone() function which indicates whether a background loading operation is finished returns 0 (FALSE), indicating the net operation is still in progress. This result is primarily a problem when accessing a file or URL that does not exist. The netDone() function will always return 0. Setting conditional statements that depend on a netDone() result can be problematic. The issue is specific to Shockwave's NetFile Xtra version 8.5.1r106 and NetLingo Xtra version 8.5.1r105.

The netDone() Function is used with net Lingo functions such as getNetText(), preloadNetThing(), gotoNetMovie(), gotoNetPage(), or putNetText(). For more information on net operations see the Director MX documentation. Managing and Publishing Projects > Using Shockwave Player > Checking whether media elements are loaded with Lingo > Downloading files from the Internet with Lingo.

Solution
This issue is revolved by updating the netLingo Xtra. Developers should update the netLingo Xtra in the Director MX Xtras folder. For more information see Xtras and fontMap.txt updates for Director MX (TechNote 16830). Users of the Shockwave player should update the player. For more information about enabling or disabling the Shockwave Player "auto-update" feature see How to disable the auto update setting in Shockwave (TechNote 16683).

Alternate Workaround
Use 'startTimer' and 'the time' to check how long a net operation has been activated. If an acceptable time has passed and netDone has not returned "OK", 'the timer' can be used to indicate problems accessing the file.
Code example:

global myNetID
on exitFrame me
 myNetID = preLoadNetThing("http://someURL/whatEver.jpg")
  startTimer
end

On next frame use:

global myNetID
on exitFrame me

  if the timer > 1000 then go to frame 30
  if netDone(myNetID) = false then
    go to the frame
  end if
end

It is also possible to use a Timeout Object to implement the same functionality. Using a timeout object allows the application to continue to navigate without holding on a specific frame and it will also no longer be frame rate dependent:

on exitFrame me
   myNetID = preLoadNetThing("http://someURL/whatEver.jpg")
   timeout("myTimeOut").new(1000, #timeoutHandler)
end

In a movie script:

on timeoutHandler me
   go to frame 30
   timeout("myTimeOut").forget()
end


ID: 16738
Product: Director
Versions: MX
OS: All
Browser: All
Server: None
Database: None
Former ID: N/A
How useful was this document?
less more

1

2

3

4

5

How can the document be improved? (300 characters or less - you will not receive a reply.)

Last updated: March 7, 2003
Created: March 7, 2003